package com.weishi.project.api.ret;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.weishi.project.training.domain.AnnualPlan;
import com.weishi.project.training.domain.TrainingWeek;
import lombok.Data;

import java.util.Date;
import java.util.List;

@Data
public class AnnualPlanRet {

    private Integer id;

    private String cycleName;

    private List<WeekRet> weekRets;

    private List<TrainingWeek> trainingWeeks;


    public AnnualPlanRet(AnnualPlan annualPlan){
        this.id = annualPlan.getId();
        this.cycleName = annualPlan.getCycleName();
    }

    public static WeekRet getWeekRet(){
        return new WeekRet();
    }

    @Data
    public static class WeekRet{

        private String name;

        //第几周
        private int index;

        /**
         * 开始时间
         */
        @JsonFormat(pattern = "yyyy-MM-dd")
        private Date startTime;

        /** 结束时间 */
        @JsonFormat(pattern = "yyyy-MM-dd")
        private Date endTime;
    }

}
